Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 1, 2026.

Mod rewrite

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch
Impact
18
hi

does anyone know how to mod rewrite..?

i would like to make my website page in following format


from 'http://domain.com/forums/index.php"

to 'http://domain.com/index"

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Just the one page? Or do you want rewrite a whole series of pages? Instead of using a filename without an extension like /index, I would recommend adding an extension, like .html to it so its /index.html

The one page is pretty simple. Just create a .htaccess file in your root directory with the following:

Code:
RewriteEngine On

RewriteRule ^index.html forums/index.php

<Files *.html> 
ForceType application/x-httpd-php 
</Files>
<Files *.htm> 
ForceType application/x-httpd-php 
</Files>

Keep in mind though if you're using ModRewrite to direct to a file in a different directory, your HTML may have to be modified if it uses relative paths for the images. Else it will be looking for your images in /images/ instead of /forums/images/ . Same for links. Maybe if you let me know what your intended purpose is I could better assist with some rewrite advice.
 
0
•••
thanks -RJ- for replay

yeah no problem i will use "http://domain.com/forums/" use same url no need to redirect it to "http://domain.com" but how can i make them int to .html

my intention was to just make it search engine friendly

my site will use ip forums
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back