It was working until my hosting do some changes to server. I don't know what changes they have made.
request is: click here
or
http://mysite.com/tiny_mce/plugins/imagemanager/js/compressor.php?classes=mox.Event,mox.List,mox.DOM,mox.geom.Point,mox.geom.Rect,mox.String,mox.dom.Drag,mox.tpl.Template,mox.tpl.Paging,mox.data.ResultSet,mox.net.Cookie,mox.ui.WindowManager,mox.ui.Menu,mox.ui.MenuItem,mox.ui.DropMenu,mox.ui.DropMenuItem,mox.dom.Layer,mox.dom.Tween,mox.net.JSON,mox.dom.Form,mox.util.Dispatcher,moxiecode.manager.BaseManager,moxiecode.manager.ImageManager,moxiecode.manager.DevKit
it returns NetworkError: 404 Not Found
if i remove mox.net.Cookie and mox.net.JSON by hand from the querystring it works.
What should be the problem? How can i solve it.
I use CodeIgniter.
Thank you.
If you're using .htaccess it may be possible you're heading to a CI controller rather than the file you're looking for.
Here is an example mod_rewrite rule that might help. Often it's worth checking your access log to see which file is being called also.
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|media|favicon\.ico|ipadicon\.jpg|tiny_mce)
RewriteRule ^(.*)$ /index.php/$1
Related
Many people post that following htaccess works for removing "public" from url. But i am working on WAMP and this is not working:
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
This shows following Error message from Laravel framework:
Sorry, the page you are looking for could not be found. 1/1 NotFoundHttpException in RouteCollection.php line 161:
There are other methods to remove "public" from url but I want to understand why this method is not working on my side which people followed frequently in their posts. my url is : http://localhost/laravel/ (directory: d:/wamp/www/laravel)
Can any one help me to understand why this popular method is not working on my side? Is their any issue in Laravel internal routing as I think my htaccess is working properly?
Thanks a lot in Advance.
I am sorry this is not exactly what you wanted but... Instead of rewriting the path, go to your Apache config and change your directory so it includes /public as well. That way you will get rid of the now necessary public from the URL. I know it is not an answer to your question, so please do not downvote. Nevertheless, it should solve your problem.
Your router is not picking up the redirected path because your laravel installation is a subdirectory within your webserver and the RewriteRule ^(.*)$ is picking up the whole path which includes /laravel. This is being appended to public/ because it's captured in $1.
The simplest case for you may be to alter the RewriteRule to not capture the laravel directory.
eg:
ReqriteRule ^laravel/(.*)$ public/$1 [L]
You may or may not need a forward slash ^/laravel/(.*)$ ...
Alternatively, (and more correctly) you should setup a virtual host within your apache configuration to serve the laravel application in the root of a virtual host (as it's designed) or you might be better off in the long run using Laravel Homestead as a preconfigured development environment.
I have a slight issue. I have configured my default controller as :
c$route['default_controller'] = 'news';
so when I point my browser to http://localhost/mysite all the news get loaded as instructed by the news controller.
Now on this page, I have given links to "read article" to read the full article. For this I have to point my browser to http://localhost/index.php/news/view/news-slug. I want to remove index.php from the url. I had already tried re-routing using wildcard without any success. Can you tell me how to do that?
There is a documentation on removing the index.php from the URL if you are using Apache with it's mod_rewrite:
Removing the index.php file
Using the following rewrite code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Also, there are many similar questions to yours, have a look at these questions from the search:
Search query on removing index.php in Codeigniter
You need to define your .htaccess file for this. Check this wiki: http://codeigniter.com/wiki/mod_rewrite
I am trying to make clean URLs. I have written a simple rule on the .htaccess file and I have been told that it should work. However, it does not. I was wondering if it might have something to so with mod_rewrite not being enabled.
I am using Network Solutions shared hosting. I called the company and was told that mod_rewrite is enabled by default on the hosting I have.
Any advice on how I can check to see if mod_rewrite is enabled? Also, I would appreciate any related advice.
Thanks in advance,
John
EDIT: I just posted this at Serverfault.com, but I'm hesitant to delete it here since I have a feeling it might get more views here. Let me know if I should delete it here as well. Thanks.
EDIT:
Below is my .htaccess file. I am getting a 404 error when I go to a URL that this should re-write.
RewriteEngine On
RewriteRule ^comments/([A-Za-z0-9-]+)-([0-9]+)?$ index.php?submissionid=$2 [NC,L]
Try putting up a bad .htaccess file (i.e. random text) in a test folder. You should get all 500 errors from that folder. If not, .htaccess files are not enabled, and you'll have to get your hosting company to switch them on.
Then try a really simple rewrite rule:
RewriteEngine On
RewriteRule foo index.php
and see if that works. If you get a 500 error at this stage, mod_rewrite is probaby not enabled.
I have a project that uses the moodle library. I had to change the URL from moodle.example.com to learn.example.com, due to a client request.
I thought this would be an easy change, but alas moodle inserts all links and images in with the complete url instead of the relative url.
Is it possible using mod-rewrite to point all requests to moodle.example.com to learn.example.com and maintain the query string?
Example:
I want a request to: http://moodle.example.com/course/view.php?id=2&topic=1 to go to http://learn.example.com/course/view.php?id=2&topic=1.
Is this possible?
Thanks,
Josh
Try this rule:
RewriteCond %{HTTP_HOST} =moodle.example.com [NC]
RewriteRule ^ http://learn.example.com%{REQUEST_URI} [L,R=301]
In addition to the apache rewrite rules, it may also be worth looking at the moodle documentation on migration: http://docs.moodle.org/en/Moodle_migration
In particular look out for admin/replace.php. This tool can help you to rewrite links across all text in the moodle database at the same time.
My problem is that i have a functioning subdomain (sub.mydomain.com). sub is loaded in mydomain.com/sub.
What i would like to do is to redirect all requests to sub.mydomain.com to mydomain.com.
Somehow it seems that when im the subdomain i cannot access the rootfolder (main domain). I can get it working with from mydomain.com/sub to mydomain.com. But not from the subdomain.
Currently im using:
RewriteEngine on
RewriteRule ^(.*)/?$ /home/web/webuser/$1 [L]
When accessing sub.mydomain.com i get a 500 Internal Server Error.
Is there a restriction in accessing the main from a sub? (rights wise)
Or maybe another way of getting to main, perhaps something like (../$1)
Thanks
EDIT:
I only have access to .htaccess. So DocumentRoot cannot AFAIK be used in .htaccess file.
What about symlinks? I dont really know what it does, but i assume that it links two locations? The only code i found for that enables symlinks (Options +FollowSymlinks) - but this line doesnt say anything about what to link (perhaps im all wrong)
Btw. thanks for input so far !
I must admit that I did not fully understand your question. Do you want to redirect everything from sub.mydomain.com/whatever to mydomain.com/whatever? In that case, the following (put in the config file of your sub.mydomain.com) might work:
RewriteEngine On
RewriteRule ^/(.*)$ http://mydomain.com/$1 [R,L]
It redirects on the client side, meaning that the user will see mydomain.com/sub in the browser.
EDIT: I think I understand your question now. Yes, it's a permissions issue: If the DocumentRoot of your web site is /whatever/sub, then you cannot just access /whatever by adding "/.." to the URL. I hope you understand that this is a good thing. :-) mod_rewrite just changes the URL, so it cannot do that either.
So, to solve your problem, you need to either change the DocumentRoot of sub.mydomain.com or create a symlink that allows you to access the required directory (e.g. /whatever/sub/redir-target -> /whatever). Be careful with the symlink option, though, since it will create valid directories of infinite length on your file system (/whatever/sub/redir-target/sub/redir-target/...) and some scripts cannot cope with that.
EDIT2: Instead of a symlink, you might want to create an alias, e.g., something like this:
Alias /redir-target /home/web/webuser
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/redir-target/.*$
RewriteRule ^/(.*)$ /redir-target/$1
Still, I think the easiest solution is to change the DocumentRoot...
Why not try using a Redirect Directive from mod_alias?
It's difficult to provide a definitive answer without knowing more about your server configuration.
The following might work and is at the very least a decent starting point:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.mydomain\.com
RewriteRule (.*) /$1 [L]
Ideally that would go in your httpd.conf, but might work from a .htaccess file (again, more information about how your subdomains are setup would be helpful).