mod-rewrite

CodeIgniter .htaccess RewriteRule result in 404 Page Not Found

余生长醉 提交于 2019-12-13 01:50:17
问题 I used the following .htacces to route from an old page to a new one: RewriteEngine on RewriteCond %{REQUEST_URI} /Uploader2.7.0/secureFileUploader.php RewriteRule ^(.*)$ /uploader/upload [L,QSA] Even though the rewrite rule is correct, I got a '404 page not found' error. This .htacces is at the root of my site. Based on this answer, I changed: $config['uri_protocol'] = 'AUTO'; to $config['uri_protocol'] = 'REQUEST_URI'; And that made the reroute rule work fine, but the CLI stopped working.

modrewrite issue - 404 error

可紊 提交于 2019-12-13 01:43:14
问题 I have this url http://sites.com/driver.php?n=spa I made it look like this http://sites.com/driver/spa here is .htaccess code I am using.. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^driver([^/]*)$ driver.php?n=$1 [L,QSA] it's working but for instance all my files including scripts and stylesheets are not working because it's adding to /driver to all urls like this example http://sites.com/style.css to http://sites.com/driver/style.css

.htaccess redirect without redirect loop

夙愿已清 提交于 2019-12-13 01:42:25
问题 Im sure there is an answer out there for this somewhere but its doing my head in and I hate anything to do with .htaccess redirects. Basically I am trying to do this RewriteRule /about/(.*) http://www.domain.com/example/about/$1 [R=301,L]. Problem is that this results in a redirect loop because "about" is in both the redirected from and redirected to url. What id like to do is have it so that it will only redirect if the root url is before the /about/. I did try doing this with this:

How to make dynamic mod-rewrite for subdirs

▼魔方 西西 提交于 2019-12-13 01:39:06
问题 I have this dir structure on my webpage: rootOfweb/services/oneservice/service1.php rootOfweb/services/oneservice/service2.php rootOfweb/services/anothersercice/service1.php rootOfweb/services/anothersercice/service2.php www.example.com/index.php?sideID=nameOfService&p=services/oneservice/service2 I have this code in php including files thats needed: <?php if(isset($_GET["p"])) { $side = $_GET["p"]; include ($side.'.php'); } ?> I have diffrent names on the diffrent subdirs and i have made one

301 Redirect old dynamic URL to new dynamic URL

人走茶凉 提交于 2019-12-13 01:36:11
问题 My .htaccess look like as below Options +FollowSymLinks RewriteEngine On RewriteRule ^condos-([^-]*)-([^-]*)\.html$ /fm /cond_new?r_id=$1&location=$2 [L] The above URL is my old dynamic URL http://localhost/fm/condos-2-delhi.html My new dynamic URL is http://localhost/fm/delhi/2/condos and .htaccess has below pattern RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ /fm /condo_new?location=$1&r_id=$2&name=$3 [L] Now i want all URLs of pattern http://localhost/fm/condos-2-delhi.html shall redirect to

Need a specific URL RewriteRule in .htaccess

喜你入骨 提交于 2019-12-13 01:28:35
问题 I am new to setting up the .htaccess and I would appreciate some help in my problem. If the user hits the following URL (original URL): http://www.example.com/somepage/something I want it to redirect to: http://www.example.com/somepage AND keep the original URL in the browser. So far, I have the following: RewriteRule ^somepage/(.*)$ /somepage [R=301] But, it doesnt work. How do I get this working? EDIT: Here is what my .htaccess file looks like right now: # do not allow anyone else to read

Strange URL RewriteRule .htaccess Issue needs explaination

为君一笑 提交于 2019-12-13 01:27:17
问题 I have URLs like book.php?id=23 and using htaccess to make them book/id/title I tried this RewriteRule ^book/([0-9]+)/([^/]+)/?$ book.php?id=$1 [NC,L,QSA] but it didn't work, it was forwarding to books.php but no $_REQUEST data it turned out it was because the url reference was the same as the name as the php file I was calling with help from the community to work around this worked RewriteRule ^books/([0-9]+)/([^/]+)/?$ book.php?id=$1 [NC,L,QSA] this is my current working .htaccess:

Unable to access the controller in subfolder

和自甴很熟 提交于 2019-12-13 01:18:28
问题 As stated in my previous question, I some how managed to cop up with this one, by using the URL like myproject-local.com/admin/index But now I have added another controller, say category in admin directory and when I go to myproject-local.com/admin/category , it gives me 404 Routes.php $route['default_controller'] = "welcome"; $route['admin/(:any)'] = "admin/admin/$1"; $route['404_override'] = ''; .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME

sogou spider still hitting our website even after blocking it

北慕城南 提交于 2019-12-13 01:14:00
问题 Our website was getting many hits from "Sogou web spider", So we thought of blocking it using htaccess rules. We created below rules - RewriteCond %{HTTP_USER_AGENT} Sogou [NC] RewriteRule ^.*$ - [L] However we are still getting hits from Sogou. I would like to know what changes should I make in this rule to block Sogou. Thanking you, 回答1: As @faa mentioned, you're not actually blocking anything: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} Sogou [NC] RewriteRule ^.*$ map.txt [R=403] Make

Redirect all pages to new domain exclude one page with htacces

泄露秘密 提交于 2019-12-13 00:54:50
问题 I try redirect all pages to new domain exclude one page with htacces. RewriteCond %{REQUEST_URI}!^/onepage.php/ RewriteRule (.*) http://newdomain.com/$1 [R=301,L] This is working but page onepage.php show internal error 500 回答1: You can try with either of the following in your .htaccess file: Example 1: Check the request URI for onepage.php and redirect if it is not being requested: RewriteEngine on RewriteCond %{REQUEST_URI} !^/onepage.php [NC] RewriteRule ^(.*)$ http://newdomain.com/$1 [R