Mod_rewrite help please

SpaceshipSpaceship
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Watch

bomb

Established Member
Impact
1
Hey everyone, I needed a bit of help regarding a .htaccess file I was making.

Basically, I wanted all my URL's on my site to look nicer. So what I did was made this:


Code:
    RewriteEngine On
    RewriteRule ^uploadfinished.html$ index.php?c=myuploader&m=uploadFiles
    RewriteRule ^signup.html$ index.php?c=user&m=signup
    RewriteRule ^index.html$ index.php?c=home&m=main
    RewriteRule ^myshare.html$ index.php?c=user&m=myShare1
    RewriteRule ^myshare1.html$ index.php?c=user&m=myshare1
    RewriteRule ^remoteupload.html$ index.php?c=myuploader&m=remoteUpload
    RewriteRule ^upload.html$ index.php?c=myuploader&m=main
    RewriteRule ^reportabuse.html$ index.php?c=home&m=contact&p=abuse
    RewriteRule ^terms.html$ index.php?c=home&m=condition
    RewriteRule ^faq.html$ index.php?c=home&m=faq
    RewriteRule ^contact.html$ index.php?c=home&m=contact&p=contact
    RewriteRule ^file([0-9]*)\.html$ index.php?c=myuploader&m=searchMyshare&link=([0-9]*)

The thing is, if I go to signup.html, it's all fine, but I want index.php?c=user&m=signup to show as signup.html.

Can someone please help be do that?

Also the last one just wont work, I want index.php?c=myuploader&m=searchMyshare&link=80 to show as file-80.html but I can't seem to do so.

Thanks.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hey,

The way you've got it there looks kinda of right,

Code:
RewriteRule ^file([0-9]*)\.html$ index.php?c=myuploader&m=searchMyshare&link=([0-9]*)

Should be
Code:
RewriteRule ^file-([0-9]*)\.html$ index.php?c=myuploader&m=searchMyshare&link=$1

Let me know if that works :)
 
0
Close
beaver6813 is correct on the last one.

My understanding on your other question is you want:

index.php?c=user&m=signup to redirect to signup.html

and

index.php?c=myuploader&m=searchMyshare&link=80 to redirect to file-80.html ?

If you add [L] to the end of all those lines and add

Code:
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

RewriteCond %{QUERY_STRING} ^c=myuploader&m=searchMyshare&link=([0-9]*)$
RewriteRule index.php file$1.html? [R=301,L]

RewriteCond %{QUERY_STRING} ^c=user&m=signup$
RewriteRule index.php signup.html? [R=301,L]
Before your other rules it should do what you want.

This will make it so clicking or typing in yourdomain.com/index.php?c=myuploader&m=searchMyshare&link=80 shows up in the address bar as file-80.html but will still load the same stuff.
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back