Mod Rewriting (URL Rewriting)

Status
Not open for further replies.

swissr3

New Member
Messages
11
Reaction score
0
Points
1
Hello Admins,

Kindly advise if the mod_rewrite is enabled on the servers or not. I've written some code that depends on URL Rewriting. This is why I'm asking, as now I'm unable to use the website normally.
 

Ohso

Member
Prime Account
Messages
114
Reaction score
4
Points
18
It is enabled on the free servers I can confirm as I also am using url rewriting.
 

swissr3

New Member
Messages
11
Reaction score
0
Points
1
I'm not having my URL rewritten correctly! Actually, when rewritten, I get a 404 Error!!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
99% of the time

1. The link was in error
2. The rewrite code was in error
3. The ultimate target was actually missing
 

swissr3

New Member
Messages
11
Reaction score
0
Points
1
99% of the time

1. The link was in error
2. The rewrite code was in error
3. The ultimate target was actually missing

I have already added the files to my local WAMP Server and access it via http://localhost .. it is working fine with me. But whenever I upload the files to x10 and try going to it, it fails! Any suggestions?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Any suggestions?

Since I do not know
1. The contents of your .htaccess file
2. A URL that shows the links that the .htaccess is supposed to rewrite
3. The real name of the file that the link is supposed to be rewritten to

it is rather hard to even guess the problem.

One thing. If you are running your local server on a Windows machine, there are several things that can go wrong when you transfer it to a *nix machine.
 

swissr3

New Member
Messages
11
Reaction score
0
Points
1
My Apache is actually running on Windows 7.

Here are the contects of the .htaccess file:

Code:
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
AuthUserFile **********************
AuthGroupFile /dev/nullAuthName "Please enter your ID and password"
AuthType Basic
require valid-user
order deny,allow

Options +FollowSymLinks
RewriteEngine on
RewriteBase /someFolder
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule /R/(.*)/ index.php?R=$1

I've taken another look at the .htaccess file and found that the RewriteBase is not correct. After adjusting it, I started receiving 500 Internal Server Error. I changed it to the below:

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /correctFolder
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteRule /cmd/(.*)/ index.php?cmd=$1

Can you advise how to solve this?

Also, when I'm on the Windows 7 Machine, when I go to the folder via browser, I get the URL like this: http://localhost/correctFolder/index/R/myString .. I want to remove the /index/ part and have the URL just be http://localhost/correctFolder/R/myString where the original URL is http://localhost/correctFolder/inde.php?R=myString
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Since I do not know

2. A URL that shows the links that the .htaccess is supposed to rewrite
3. The real name of the file that the link is supposed to be rewritten to

Okay. You don't want to divulge information that can help me to help you.

Good luck.
 

swissr3

New Member
Messages
11
Reaction score
0
Points
1
Okay. You don't want to divulge information that can help me to help you.

Good luck.
You mean, you want the link before and after rewriting and also the exact file names?

If that is it, the URL is http://*.x10.mx/roster/index.php <-- This is the homepage.

When a link is clicked, it should go to http://*.x10.mx/roster/index/R/Nov-2013 which should be rewritten to http://*.x10.mx/roster/index.php?R=Nov-2013 .. This is working fine on Windows 7 that has WAMP Server Installed, but when uploaded to X10, it gives 500 Internal Server Error.
 
Last edited:
Status
Not open for further replies.
Top