Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'l make this short and sweet:
I want to type in this:
http://pachonk.com/alex/admin/user/
And get this:
http://pachonk.com/alex/admin/index.php?page=users
I'm trying to use:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /alex
RewriteRule ^admin/([a-zA-Z0-9]+)/?$ admin/index.php?page=$1
With other variations, but this isn't working. What's wrong?
Make sure mod_rewrite and .htaccess are enabled in httpd.conf. Then put this slightly modified code in $DOCUMENT_ROOT/alex/.htaccess directory:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /alex/
RewriteRule ^admin/([a-zA-Z0-9]+)/?$ admin/index.php?page=$1 [L,QSA]
Related
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
i have a page in my siteA
http://www.siteA.com/1987/title.html
i want to 301 redirect above page to a page in external site siteB as shown in example below
http://www.siteB.com/page/title3.html
I want to do this in htacess, not in php
I have tried
#redirect 301 /1987/title.html http://www.siteB.com/page/title3.html
this doesnot seem to work for me
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.siteA\.com$ [NC]
RewriteRule ^1987/title\.html$ http://www.siteB.com/page/title3.html [L,R=301,NC]
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
i want to redirect page url using .htaccess [R=301]
original url : http://www.encros.fr/la-boutique-encros/recharge-toner
redirect url : http://www.encros.fr/recharge-toner
anybody can help me ?
You need something like this in your .htaccess file:
RewriteEngine on
RewriteRule ^/la-boutique-encros/recharge-toner$ /recharge-toner [R=301,L]
The [R=301] flag sets the return code. The [L] flag prevents other rules from being applied to this specific rewrite.
References:
About rewrite: http://httpd.apache.org/docs/2.4/rewrite/remapping.html
About the rewrite flags: http://httpd.apache.org/docs/2.4/rewrite/flags.html
Try this
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^recharge-toner$ /la-boutique-encros/recharge-toner [L]
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
How to rewrite img.php?p=$id to img/$id in .htaccess, where $id is id of the image in database?
I tried this, but I get error - nothing found.
RewriteEngine On
RewriteBase /
RewriteRule img/^([0-9_-]+)$ img.php?p=$1
RewriteRule img/^([0-9_-]+)/$ img.php?p=$1
Replace your code with this code:
RewriteEngine On
RewriteBase /
RewriteRule ^img/([0-9_-]+)$ /img.php?p=$1 [L,QSA,NC]
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
OK, I admit ... I blow at htaccess! Therefore, I now deal with it.
I want a page like:
index.php -> localhost
index.php?group=1 -> localhost/1(/)
index.php?group=1&page=1 -> localhost/1/1(/)
So far, no problem .. However, after this I would be able to add your own GET tags.
Eg. I want the URL to be:
localhost/audi/guestbook?do=delete&id=54
Here I can not get $_GET['do'] or $ _GET['id'].
My Htaccess:
RewriteEngine on
RewriteBase /
RewriteRule ^([^/\.]+)/?$ index.php?group=$1
RewriteRule ^([^/\.]+)/?/([[a-zA-Z0-9_-]+)$ index.php?group=$1&page=$2
Grateful for sensible answer!
Add [QSA] flag to the two rewrite rules (And the [L] flag as well:
RewriteEngine on
RewriteBase /
RewriteRule ^([^/\.]+)/?$ index.php?group=$1 [L,QSA]
RewriteRule ^([^/\.]+)/?/([[a-zA-Z0-9_-]+)$ index.php?group=$1&page=$2 [L,QSA]
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
how can i change
http://www.mydomain.com/down.php?key=1223
to
http://www.mydomain.com/?k=1223
i have google it but not found any ans...please help me...
i am using apache server with unix
You should use mod_rewrite. Add to your .htaccess file those lines:
RewriteEngine On
RewriteBase /
RewriteRule ^\s+\.php\?key=(\d+) \?k=$1
Read about mod_rewrite and RewriteRules here:
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteRule
RewriteCond %{QUERY_STRING} key=(.*)
RewriteRule /down.php /?k=%1 [R]