Please help me to redirect http://subdomain.example.com/page/subpage
to http://www.example.com/index.php?subdomain=subdomain&page=page&subpage=subpage
with htaccess. I'll learn how it is done with a final code. Some variables may be omitted at some pages.
Related
Using wordpress, I have already my url shortened to this domain.com/(article)/image-(image-slug)
where (article) and (image-slug) are variables.
Note that the paranthesis are here only to show what are the variables.
I want to end up whith this form of url domain.com/(image-slug) using htaccess file.
Please view this article from another user who had a similar problem, which they solved using PHP inside there .htacess.
.htaccess shorten URL using php $_GET
I'm having some difficulty creating an htaccess mod_rewrite rule which would take the following URL:
http://www.mydomain.com/index.php?route=product/search&filter_name=SEARCH%20CRITERIA
and make it something more along the lines of:
http://www.mydomain.com/search/SEARCH-CRITERIA
or even
http://www.mydomain.com/search?filter_name=SEARCH%20CRITERIA
Everything I've tried seems to break the SEO-friendly URLs that are auto-generated by the Opencart framework. How can this be done?
In Your .htaccess file place the rules directly behind the lines used to rewrite sitemap.xml and googlebase.xml and before the last general rule.
The rule could look like:
RewriteRule ^search\/(.*)$ index.php?route=product/search&filter_name=$1
- did not test it, it is just a guess.
Also showing us what have You tried would be highly appreciated.
I'm trying to redirect some files and I'm pretty stuck. There are way too many to do some of them on a "page-per-page" basis and so I need a quick way as these pages are insignificant but return 404's at the moment.
I have a page like this "/old-blog/tag/page", I previously redirected the "old-blog" to "new-blog" so I get "/new-blog/tag/page" but now I want "tag" and all pages after this to be sent to "new-blog". I hope this example makes sense, please ask if I've missed something.
I'm doing my redirects with my .htaccess file so I'd like a method I can use with this in mind.
Thanks, Dan.
You may already have rewrite rules, if there are rules that do some type of routing, then mod_rewrite and mod_alias is going to conflict (RedirectMatch is mod_alias). So try sticking with just mod_rewrite. Try adding these rules, above any other rules, in the htaccess file in your document root:
RewriteEngine On
RewriteRule ^/?old-blog/tag /new-blog/ [L,R=301]
Does anyone know if there is an .htaccess rule to redirect from somthing like this...
XXX/dodge/604-jeep-hard-start-cold
to...
XXX/dodge/jeep-hard-start-cold
Basically wondering if there is some sort a variable that will remove the number from URL's.
All URL's have different numbers, so it cant just be the 604 getting a redirect.
It is a Joomla site, and numbers refer to article #.
Thanks for any help !
Sounds like you need to configure Joomla to not add the article number to the url of the article. You can turn on Search Enging Friendly urls in the Global Configuration.
I wish to redirect all page requests if
(1) Current URL doesn't have .php extension
(2) Current Page is not the Site Home (ie www.site.com )
Example:
http://site.com/robin to profile.php?screen_name=robin
Can someone suggests the htaccess to accomplish this?
This site should give some hints:
http://www.webweaver.nu/html-tips/web-redirection.shtml
an excerpt from there:
Changed file extension?
This example is perfect if you've
decided to switch to .php from .html
pages. It will look for any .html page
and redirect it to .php (ie
http://www.example.com/yourpage.html
and redirect it to
http://www.example.com/yourpage.php).
Now, be careful with this, it does
mean any html page. I did this on one
of my sites and had totally forgotten
I had an iframe with .html content on
some pages... I didn't notice for
weeks that it was broken :S. So learn
from my mistake ;-) check, double
check, then check again.
RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php
You can put arbitrary regular expressions as parameter to Redirectmatch, so you need to add a regular expression which matches '".php" not last of line'. I am only a neophyte of RegExes myelf, so i do not provide an example yet. Check for a later update -have to do some experimating.