logo
down
shadow

How to rewrite then redirect the old URL to the rewrited URL


How to rewrite then redirect the old URL to the rewrited URL

By : Gianluigi Tufo
Date : November 17 2020, 11:58 AM
around this issue For eg. I have this link: http://example.com/url.html. Using this rule: , This will work:
code :
RedirectMatch 301 ^(/url.html)$ http://example.com/url


Share : facebook icon twitter icon
after .htaccess url rewrite, cannot perform logoff in some of the url rewrited page

after .htaccess url rewrite, cannot perform logoff in some of the url rewrited page


By : user2048793
Date : March 29 2020, 07:55 AM
it helps some times Recently, I was doing .htaccess url rewrite, make all my php url into html, in some page, the logout button wont work properly. for example, in page ‘quotedetails/Q9999.html’ (rewrited from ‘quotedetails.php?quoteID=Q9999′), when I click logout button in this page, it wont do the trick, but when i use the old php url of this page, it works again, other rewrited pages like index.html (index.php), search.html(search.php), all works perfectly. ,
all the CSS will be lost, how to fix this issue?
Apache rewrite rule to redirect all request to subdirectory containing another .htaccess and rewrite rules

Apache rewrite rule to redirect all request to subdirectory containing another .htaccess and rewrite rules


By : slothinker
Date : March 29 2020, 07:55 AM
it should still fix some issue All you need in your case is mod_alias.
Then serve your private project like:
code :
Alias /project3 /apache/htdocs/private/project3
RewriteRule ^/(project1)$ /private/$1/index.html
RewriteRule ^/(project1/)(.*)$ /private/$1$2
ISAPI Rewrite : Append querystring to the rewrited URl's Query String

ISAPI Rewrite : Append querystring to the rewrited URl's Query String


By : user3770769
Date : March 29 2020, 07:55 AM
wish help you to fix your issue The following rule, appends the query string to the rewritten URL's Querystring and avoids the 404 error
URL With Querystring and Trailing slash(/)
code :
RewriteRule ^/Product-name/\? /test.cfm?ProductID=xxxx [NC,L,QSA]
RewriteRule ^/Product-name\? /test.cfm?ProductID=xxxx [NC,L,QSA]
RewriteRule ^/Product-name/$ /test.cfm?ProductID=xxxx [NC,L]
RewriteRule ^/Product-name$ /test.cfm?ProductID=xxxx [NC,L]
301 Redirect dynamic url to a rewrited url

301 Redirect dynamic url to a rewrited url


By : sergiu
Date : March 29 2020, 07:55 AM
I wish did fix the issue. I want to redirect all dynamic links to redirect to its rewritten url eg: , Try this in your htaccess :
code :
 RewriteEngine on
#1) redirect "/ads-detail.php?location=foo&id=123&name=bar" to "/foo/123/bar"
RewriteCond %{THE_REQUEST} /ads-detail.php\?location=([^&]+)&id=([^&]+)&name=([^\s]+) [NC]
RewriteRule ^ /%1/%2/%3? [NC,L,R]

#2) if the requested  is not for an existing directory
RewriteCond %{REQUEST_FILENAME} !-d

 #3) then rewrite "/foo/123/bar" to "ads-details.php"
 RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ /ads-detail.php?location=$1&id=$2&name=$3 [NC,L]
301 redirect to the rewrited url

301 redirect to the rewrited url


By : GreenChum
Date : March 29 2020, 07:55 AM
will be helpful for those in need The CMS i am working with has these rewrite rules: , You need to create 4 new rules and place them above your existing.
code :
#redirect old URL to new SEO
RewriteCond %{THE_REQUEST} ^GET\ /+tag\.php\?t=([^&\s]+)&page=1
RewriteRule ^ /tags/%1/? [R=301,L]
#redirect old URL to new SEO
RewriteCond %{THE_REQUEST} ^GET\ /+tag\.php\?t=([^&\s]+)&page=([^&\s]+)
RewriteRule ^ /tags/%1/page-%2/? [R=301,L]
#redirect old URL to new SEO
RewriteCond %{THE_REQUEST} ^GET\ /+category\.php\?cat=([^&\s]+)&page=([^&\s]+)&sortby=([^&\s]+)
RewriteRule ^ /browse-%1-videos-%2-%3.html? [R=301,L]
#redirect old URL to new SEO
RewriteCond %{THE_REQUEST} ^GET\ /+category\.php\?cat=([^&\s]+)
RewriteRule ^ /browse-%1-videos.html? [R=301,L]

RewriteRule ^tags/([^/]+)/$ tag.php?t=$1&page=1 [L]
RewriteRule ^tags/([^/]+)/page-([0-9]+)(/)?$ tag.php?t=$1&page=$2 [L]

RewriteRule ^browse-(.*)-videos.html$ category.php?cat=$1 [L]
RewriteRule ^browse-(.*)-videos-([0-9]+)-(.*).html$ category.php?cat=$1&page=$2&sortby=$3 [L]
Related Posts Related Posts :
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org