Some problem on URL Rewrite using RewriteRule When somebody uses this in a page then all hyperlinks in that page is rewritten in sub-directory format, which the webmaster hardly wants As for example - www.abc.com/file.php has a hyperlink in it as home page (<a href='index.php'>Home Page</a>) which points index.php page of www.abc.com, that is absolute URL www.abc.com/index.php . index.php and file.php is in same directory of website www.abc.com Now, say, www.abc.com/file.php?varname=value is rewritten in search engine friendly way www.abc.com/file/varname/value/ When this search engine friendly URL is typed in a browser, the same page opens which is file.php, but the links in that page are changed Then the Home Page hyperlink now points to /file/varname/value/index.php , that is hyperlink changes to <a href='/file/varname/value/index.php'>Home Page</a> - absolute path is www.abc.com/file/varname/value/index.php, which don't exists in reality. But the hyperlink should point to www.abc.com/index.php Have u faced this problem ?? .htaccess file content ------------------------ RewriteEngine On RewriteBase / RewriteRule ^file/varname/value/ file.php?varname=value
See the demo of the above problem here : See a demo of the problem stated above here http://demo.rankingoogle.com/seo_url/
Place the following code in the <head> section of your page <base href="http://www.abc.com/" /> This will become the root path for any relative URLs on your page. Hope this helps