htaccess rewrite remove filename - .htaccess

How can I change url in this way using htaccess?
http://www.domain.com/index.html?page=home
http://www.domain.com/indexf6f2.html?page=blog
To
http://www.domain.com/?page=home
http://www.domain.com/?page=blog

You could try to generate your own .htaccess file based on your rules using this site http://cooletips.de/htaccess/ .
Regards, Hiawatha

I am not giving exact solution. Just utilize the followings, then you will be able to solve other URL rewriting using .htaccess
Take help from the following URL
http://roshanbh.com.np/2008/03/url-rewriting-examples-htaccess.html
Other important regarding rewriting through .htaccess
http://corz.org/serv/tricks/htaccess2.php
RewriteRule to rename URL?
For a nice basic
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

Related

how to rewrite SEO friendly url in htaccess

How to create an SEO friendly URL like example.com/pages/my-first-page/followers here I want how to create a structure in if(isset($_GET['followers'])){...} and htaccess file.
My link working fine till example.com/pages/my-first-page/ but now I want to add followers section.
I hope i explain well what I expecting. Thanks for your help
Rule you've suggested is this:
RewriteRule ^pages/([\w-]+)/followers/?$ page.php?pages=$1&followers=1 [QSA,NC,L]
This is pretty good rule and there is no reason why it should not work. Make sure this rule is placed before page rule which is your first rule in .htaccess

i want a URL rewriting for my URL using only .htaccess file

My URL is
http://127.0.0.1/public_html/organisation/home/index.php?page=Your-Profile
but i want my url looks like this using .htaccess only:-
http://127.0.0.1/public_html/organisation/home/Your-Profile
i want to remove using .htaccess file index.php?page=
Please Help Me..
You can remove the /index.php as this is assumed/set by default by the engine, but you can't remove the ?page= as this is a query parameter, not part of the 'url' as you are thinking it. So it would look like http://127.0.0.1/public_html/organisation/home?page=Your-Profile
If you're using wordpress then there is an option in admin to set 'pretty urls' which would achieve this through other means.

htaccess URL overwrite - Magento

I have some URLs that I would need to overwrite so that if someone looks at the source code they can't actually see the real URLs for the product images in Magento. Currently, the link is as
externalsub.domain.com/images/image123.jpg
I want to make it as
mydomain.com/images/image123.jpg
How can I achieve this via .htaccess? Any help is much appreciated!
Then in an htaccess file, you can use this (above whatever rules you may already have):
RewriteEngine On
RewriteRule ^images/([^/]+\.(?:jpe?g|png|gif))$ http://externalsub.domain.com/images/$1 [L,P]
You don't need the line turning on the rewrite engine if you already have that (only needs to be in your file once).

.htaccess to change the url path

I have tried several examples of solutions that I have found here on StackOverflow but none of them seem to work correctly.
I have a Magento store that I need to redirect an old store code url to the new one. For example:
The old url looked like this.
www.example.com/something_en
In the above example I need to be able to modify any url that contains to the path something_en and change it to something like in the next example.
www.example.com/something
Any help is much appreciated.
Make sure this is your very first rule in main .htaccess:
RewriteEngine On
RewriteRule ^something_en(/.*)?$ /something$1 [L,NC,R=301]

htaccess mod_rewrite for Opencart search page URLs

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.

Resources