.htaccess - Relative Url in Subdirectory -


i have site on domain.com, want add sub site on blog subdirectory.

in domain.com/blog/index.html files in subdirectory, tried use post-1, /post-1 , ./post-1 link single post.

an url expected domain.com/blog/post-1 however, url on link domain.com/post-1.

can .htaccess update baseurl of subdirectory domain.com/blog/? means relative url in blog directory domain.com/blog/[some-url-here].

i tried incorrect:

<ifmodule mod_rewrite.c>   rewriteengine on   rewritebase /blog/   rewriterule ^index\.html$ / [r=301,l]   rewriterule ^blog/(.*)/index\.html$ /$1/ [r=301,l] </ifmodule> 

thank help.

your substitutions (2nd parameter rewriterule) start slash ('/'). means base never used. make them relative if want rewritebase incorporated.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -