I am trying to redirect the url:
'mysiteurl/Actors/as23sderd/1' to 'mysiteurl/cataImages.php?c=Actors&p=1'
using the following htacess code:
RewriteEngine On
RewriteRule ^([\w]+)/([a-zA-Z0-9]+)/([0-9]+)$ cataImages.php?c=$2&p=$3
But it is not redirecting now.
Please help me.
RewriteEngine On
RewriteRule ^([\w]+)/([a-zA-Z0-9]+)/([0-9]+)$ cataImages.php?c=$1&p=$3
This is what you need:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^[^/]+/([^/]+)/([0-9]+)/?$ cataImages.php?c=$1&p=$2 [L,QSA,NC]
Related
I have been trying to rewrite a url like this:
/gallery/test.php?id=1
to this:
/gallery/test/1
However it isn't working. I have url rewriting enabled and have used phpinfo() to check.
this is my code:
Options +FollowSymLinks -Multiviews
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RewriteRule ^test/([0-9]+)/?$ test.php?id=$1 [NC,L]
</IfModule>
You probably need a rewrite base. Try adding the following on the line after the RewriteEngine on line.
RewriteBase /gallery/
this is a rewrite rule that should work
RewriteEngine On
RewriteRule ^gallery/test/([^/]*)$ /gallery/test.php?id=$1 [L]
Thanks
Hi this is the RewriteRule that i am trying to apply
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteRule ^coloragon/([^/]*)\.html$ /coloragon/pair_pixel_filter.php?type=$1 [L]
for the following URL
http://localhost/coloragon/pair_pixel_filter.php?type=0
but it do not seem to work at all. Any suggestions will be appreciated.
Thanks in advance !! Actually i am suffring from url rewriting problem in php (apache server). Problem is :
I have to write
URL(Old)= abc.com/search_result.php?id=110 to
URL(New)= abc.com/110
it is working in opposite direction when i click the url abc.com/search_result.php?id=110 it does not change to abc.com/110
but when i click the url abc.com/110 it changes to abc.com/search_result.php?id=110
.htaccess code
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^([a-zA-Z0-9]+)$ http://www.abc.com/search_result.php?id=$1
website linnk : [ncrfloors.com][1]
Please anybody help me.....
On your old domain: 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 %{THE_REQUEST} ^[A-Z]{3,}\s/+search_result\.php\?id=([^\s]+) [NC]
RewriteRule ^ http://abc.com/%1? [R=301,L]
I am trying to get /game/game-name/ to redirect to /game.php?g=game-name
The code I am using in my .htaccess is:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^game/([a-zA-Z0-9]+)/$ game.php?g=$1
But when I go to /game/game-name/ I get a 404 Error. Any help would be appreciated.
Thanks!
That's because your rule transform this url /game/game-name/ into this /game/game-name/game.php?g=game-name
What you need to do is either this :
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^game/([a-zA-Z0-9]+)/$ /game.php?g=$1
Or this :
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^game/([a-zA-Z0-9]+)/$ game.php?g=$1
I'm trying to redirect URLs by using the .htaccess file:
index.php?i=Dengue-NS1-ELISA-kit---Antigen&id=682&cat=0
to
index.php?i=Dengue-NS1-ELISA-kit---Antigen&id=682&cat=17
Notice the 17 on the end there.
Here is the code that you need to put in .htaccess file under DOCUMENT_ROOT:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^(.*)(?:^|&)cat=0(&.*|)$ [NC]
RewriteRule ^index\.php$ index.php?%1%2&cat=17 [L,NC,R]
Here maybe you can use this tool I use it all the time http://www.htaccessredirect.net/