Hello, My problem is that when I go to http:\/\/untoldscifi.com it pulls up the other site that I have on the server as well. The http:\/\/www.untoldscifi.com works well. I don't want to get banned so you need to manually enter the urls to test. Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.untoldscifi\.com$ [NC] RewriteRule ^(.*)$ http://untoldscifi.com/$1 [L,R=301] Any help on this is greatly appreciated.
But if i can't use .htaccess what can i do? I read that i can use a php redirection but i can't understand where to place the php code. How to redirect the entire webiste from non www to www? Thanks in advance!
ServerAlias *.domain.com Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+).domain.com$ RewriteCond %{HTTP_HOST} !^(www|includes|images| )$ RewriteCond http://www.domain.com/gebruikers/$1 -d RewriteCond %{REQUEST_FILENAME} !^http://www.domain.com/gebruikers/ RewriteRule ^(.*)$ /gebruikers/$1 [L] This is a try to make all directorys in gebruikers a subdomain but it doesn't work. and when the directory doesn't excist the homepage can someone help?
For BlueEew If the php files are like "page-one.php" "page-two.php" "page-google.php" (the word "page" always remains the same) then try this.. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^/page/(.*)/$ page-$1.php [L] Code (markup):
I found a way to do it now. Thanks for sharing this also, it will help as it's different to the way I do it.
I am currently using two methods for one website to create two different URLs. Here are the following: # Force search engines to use www.domain.com RewriteCond %{HTTP_HOST} !^www\.domain\.com$ RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L] # Specify search friendly URLs RewriteRule ^category/subject/page-name/?$ /category-subject-page-name.php [L] The above to create URLs with more then one / in them, then the following: RewriteRule ^page-name/?$ /page-name.php The above to take the .php anf make it a pretty URL. Remember to always add "/?$" without the quote to the end of all pretty URLs. This will make the page work if someone enters a / or not on the end of a web-page URL for example: www.domain.com/page/ www.domain.com/page Both will work as long as it as "/?$" on the rewrite. Also the part I have bolded will also make your domain redirect to www. even if you don't add the www. when entering URL. Take the www. off this part to make it just http://.
Dear Friends, How to change this URL: detail.php?title=Super Duper Cupcakes: Kids' Creations from the Cupcake Caboose&item=1402721749 into: Super Duper Cupcakes: Kids' Creations from the Cupcake Caboose-dp-1402721749 My RewriteRule: RewriteRule ([^/]+)-dp-([A-Z0-9]+)$ detail.php?item=$2&title=$1 [NC,L] The rule works well if the title doesn't have colon ":". But, it fails when there is a colon ":" in the title and returns 403 Forbidden Page. I've tried to remove the colon in the title using php so that the requested url look like this : Super Duper Cupcakes Kids' Creations from the Cupcake Caboose-dp-1402721749 but, it still doesn't work. If I change the : to / it works but my page messed up.. How do I solve this problem ?
You wanna get it so it's like Super-Duper-Cupcakes-Kids-Creations-from-the-Cupcake-Caboose-dp-1402721749 no spaces or special characters. To get the URL looking nice, use something like... $line['title2'] = trim(preg_replace('/[^\w\d]+/', ' ', $line['title'])); $line['title2'] = str_replace(' ', '-', $line['title2']); First line get's rid of all special characters. Second line changes spaces to -.
Hi all, I am new to mod rewrite, I know that it can rewrite the url to a SEF url. but do I need to manually change the links? for example, my website is: http://www.ciel.com.hk/diamond.php here, user can search diamond base on some criteria, if i want to use the new rewrite url, how should i go about it? and for the list of items, how do i change the link of it? so instead of linking to:/diamond_detail.php?serial=CD1000288 i want it to link to: /diamond/CD1000288.htm manually? does mod rewrite does it? i know i can rewrite the url so that the latter links to the previous one if i type it in the url, but i can't figure out HOW to get there automatically. Thanks for the help in advance
A .php file won't even know you have a .htaccess file! All mod_rewrite does is makes the static URL work. You still have to change the link code.
Hi, I am new to jsp & wanted to know, how to redirect http://www.xyz.com/abc/index.jsp --> http://www.xyz.com/index.jsp my client has kept all his files in "abc" folder & wants them to root folder. All the links that are pointing to "http://www.xyz.com/abc/...." will be lost; how do i redirect them? Thank you.
Hi, I have this page mydomain.com/search/?=[B]something[/B] and I want to redirect to mydomain.com/search/[B]something[/B] having [B]RewriteRule search/(.*) /search.php?words=$1[/B] [L,QSA] Code (markup): Or just mydomain.com/search/?=[B]something[/B] to get the /search.php?words=[B]something [/B] Code (markup):
I need help.. I have a rewrite problem.. 1. www.boondockseries.com/advertise.php 2. www.boondockseries.com/contactus/advertise.php I want to change that to look like: 1. www.boondockseries.com/advertise/ 2. www.boondockseries.com/contactus/advertise/
@KleaConcepts Have you tried RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP RewriteRule (.*)\.php$ $1 [R=301] Code (markup): Does anyone know how to rewrite a subdomain name, but using the .htaccess of the main domain. So rewriting http://sub.domain.com/?page=topic&t=15.0 into http://sub.domain.com/page-title